//
//  LBDownloaderFolderUtil.m
//  LBDownloader
//
//  Created by WuShiHai on 19/6/14.
//  Copyright (c) 2019 Lebbay All rights reserved.
//

#import "LBDownloaderFolderUtil.h"

@implementation LBDownloaderFolderUtil

+ (BOOL)inspectFolderPath:(NSString *)folderPath {
    NSFileManager *fileManager = [NSFileManager defaultManager];
    BOOL isDir = NO;
    BOOL existed = [fileManager fileExistsAtPath:folderPath isDirectory:&isDir];
    if (!(isDir == YES && existed == YES)) {
        // 在 Document 目录下创建一个 head 目录
        return [fileManager createDirectoryAtPath:folderPath
                      withIntermediateDirectories:YES
                                       attributes:nil
                                            error:nil];
    }
    return isDir && existed;
}

@end
